import request from '@/utils/request'

const pre = '/mock'

export function listProject(data) {
  return request({
    url: `${pre}/project/page`,
    method: 'get',
    params: data
  })
}

export function listTask(data) {
  return request({
    url: `/fmea/common/projectStructureTask/list`,
    method: 'get',
    params: data
  })
}

export function getTaskHisInfo(data) {
  return request({
    url: `/fmea/common/projectStructureTask/getHistoryByStructureId/` + data.structureId,
    method: 'get'
  })
}

export function delTask(id) {
  return request({
    url: `/fmea/common/projectStructureTask/` + id,
    method: 'delete'
  })
}

export function completeTask(data) {
  return request({
    url: `/fmea/common/projectStructureTask/completeTask/` + data.id,
    method: 'put'
  })
}

export function exportDocumenationLog(data) {
  return request({
    url: `/fmea/common/log/export`,
    method: 'get',
    params: data
  })
}

export function exportRevision(data) {
  return request({
    url: `/fmea/common/history/export`,
    method: 'get',
    params: data
  })
}

export function searchVersion(data) {
  return request({
    url: `/fmea/common/history/selectVersionByProjectId`,
    method: 'get',
    params: data
  })
}

export function listFMEA(data) {
  return request({
    url: `${pre}project/getFmeaTable`,
    method: 'get',
    params: data
  })
}

export function getFailureMinder(data) {
  return request({
    url: `${pre}project/getFailureMinder`,
    method: 'get',
    params: data
  })
}

export function listFeature(data) {
  return request({
    url: `${pre}function/getOptimizationFeaturePage`,
    method: 'get',
    params: data
  })
}

export function listLog(data) {
  return request({
    url: `/fmea/common/log/list`,
    method: 'get',
    params: data
  })
}

export function listRevison(data) {
  return request({
    url: `/fmea/common/history/list`,
    method: 'get',
    params: data
  })
}

export function listValidation(data) {
  return request({
    url: `/fmea/common/measure/getMeasureListByPid`,
    method: 'get',
    params: data
  })
}

export function getRiskMatrixAnalysis(data) {
  return request({
    url: `${pre}project/getRiskMatrixAnalysis`,
    method: 'get',
    params: data
  })
}

export function getCharacteristicMatrix(data) {
  return request({
    url: `${pre}/function/getFeatureMatrix`,
    method: 'get',
    params: data
  })
}

export function exportValidationCheck(data) {
  return request({
    url: `/fmea/common/measure/exportValidationCheck`,
    method: 'get',
    params: data
  })
}
